<template>
	<view>
		<view class="head-o" @click="GoaddAccount">
			<view class="box-l">收款账户</view>
			<view class="box-r">
				{{ msg }}
				<image src="../../static/images/arrow_right.png" mode=""></image>
			</view>
		</view>
		<view class="head-o">
			<view class="box-l">打印注明</view>
			<view class="box-r"><image src="../../static/images/arrow_right.png" mode=""></image></view>
		</view>
		<view class="head">
			<view class="box-l">
				<view class="box-t">自动生成货品编码</view>
				<view class="box-b">在上货时会自动生成唯一的货品编码</view>
			</view>
			<view class="box-r">
				<view><switch checked @change="switch1Change" /></view>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			msg: '',
			arr: []
		};
	},
	onLoad() {
		this.seave();
	},
	methods: {
		seave() {
			this.$ajax('/api/v1.shop/index', {})
				.then(res => {
					this.arr = res.result.receive_account;
					if (this.arr.length == 0) {
						this.msg = '未设置';
					} else {
						this.msg = '已设置';
					}
					// console.log(this.arr);
				})
				.catch(res => {
					console.log(Error);
				});
		},
		shezhi() {},
		GoaddAccount() {
			if(this.msg=='未设置'){
				uni.navigateTo({
					url: 'addAccount'
				});
			}else{
				uni.navigateTo({
					url: 'paymentAccount'
				});
			}
			
		}
	}
};
</script>

<style lang="scss">
page {
	background-color: #f7f4f8;
}
switch {
	transform: scale(0.8);
}
.head {
	height: 157rpx;
	background-color: #ffffff;
	margin-top: 29rpx;
	padding: 30rpx 40rpx;
	display: flex;
	justify-content: space-between;
	font-size: 32rpx;
	font-family: PingFang SC;
	font-weight: 500;
	color: rgba(51, 51, 51, 1);
	box-sizing: border-box;
	.box-b {
		font-size: 28rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #666666;
		margin-top: 19rpx;
	}
}
.head-o {
	height: 110rpx;
	line-height: 110rpx;
	background-color: #ffffff;
	margin-top: 30rpx;
	display: flex;
	justify-content: space-between;
	padding: 0 30rpx;
	font-size: 32rpx;
	font-family: PingFang SC;
	font-weight: 500;
	image {
		width: 18rpx;
		height: 33rpx;
		vertical-align: middle;
		margin-left: 20rpx;
	}
	.box-r {
		font-size: 32rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: rgba(102, 102, 102, 1);
	}
}
</style>
